Skip to content

MDEV-40270 @@default_master_connection does not convert character sets#5350

Open
ParadoxV5 wants to merge 1 commit into
10.11from
MDEV-40270
Open

MDEV-40270 @@default_master_connection does not convert character sets#5350
ParadoxV5 wants to merge 1 commit into
10.11from
MDEV-40270

Conversation

@ParadoxV5

Copy link
Copy Markdown
Contributor

Item::val_str() doesn’t specify the collation of the returned string, yet Sys_var_session_lexstring::do_check() (for @@default_master_connection) and Sys_var_debug_sync::do_check() (for @@debug_sync) assume the @@character_set_system collation.

This commit replaces Sys_var_debug_sync::do_check() with a delegate to Sys_var_charptr::do_string_check() to match Sys_var_dbug::do_check(), as neither of those has this bug.
It ports the character set conversion to Sys_var_session_lexstring::do_check() rather than delegating, so the length check is not after a memory allocation; this class has been refactored away in 11.3 (Commit 6151bde) anyway.

`Item::val_str()` doesn’t specify the collation of the returned string,
yet `Sys_var_session_lexstring::do_check()`
(for `@@default_master_connection`) and `Sys_var_debug_sync::do_check()`
(for `@@debug_sync`) assume the `@@character_set_system` collation.

This commit replaces `Sys_var_debug_sync::do_check()`
with a delegate to `Sys_var_charptr::do_string_check()` to match
`Sys_var_dbug::do_check()`, as neither of those has this bug.
It ports the character set conversion to
`Sys_var_session_lexstring::do_check()` rather than delegating,
so the length check is not after a memory allocation;
this class has been refactored away in 11.3 (Commit 6151bde) anyway.
@ParadoxV5
ParadoxV5 requested a review from andrelkin July 7, 2026 02:49
@ParadoxV5 ParadoxV5 self-assigned this Jul 7, 2026
@ParadoxV5 ParadoxV5 added MariaDB Corporation Replication Patches involved in replication labels Jul 7, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Corporation Replication Patches involved in replication

Development

Successfully merging this pull request may close these issues.

1 participant